<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport"
        content="width=device-width, initial-scale=1">
  <title>任务详情页面</title>

  <!-- Set render engine for 360 browser -->
  <meta name="renderer" content="webkit">

  <!-- No Baidu Siteapp-->
  <meta http-equiv="Cache-Control" content="no-siteapp"/>

  <link rel="icon" type="image/png" href="images/bee.png">

  <!-- Add to homescreen for Chrome on Android -->
  <meta name="mobile-web-app-capable" content="yes">
  <!-- <link rel="icon" sizes="192x192" href="assets/i/app-icon72x72@2x.png"> -->

  <!-- Add to homescreen for Safari on iOS -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
  <!-- <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png"> -->

  <!-- Tile icon for Win8 (144x144 + tile color) -->
  <meta name="msapplication-TileImage" content="assets/i/app-icon72x72@2x.png">
  <meta name="msapplication-TileColor" content="#0e90d2">

  <link rel="stylesheet" href="assets/css/amazeui.min.css">
  <link rel="stylesheet" href="assets/css/app.css">
</head>
<body style="background: url(images/bg1.png) no-repeat;background-size: cover; background-attachment:fixed;">
  
  <!--在这里编写你的代码-->
  <!-- 页头 -->
  <header data-am-widget="header"
  class="am-header am-header-default" style="background-color: #F6B541;">
  <div class="am-header-left am-header-nav">
  <!-- <a href="#left-link">
      <span class="am-header-nav-title">
        首页
      </span>
  
        <i class="am-header-icon am-icon-home"></i>
  </a> -->
  <ul>
    <a href="yfpage.html">
      <li style="display: flex;flex-direction: row;width: 200px;">
          <img src="images/shouye.png" alt="管理员联系方式" style="width: 150px; height: 22px;margin-top: 10px; margin-left: -10%;">
          <!-- <p style="color: #000; margin-top: 0;font-size: 16px;">小蜜蜂图片收集网</p> -->
      </li>
    </a>
  </ul>
  </div>
  

  <div class="am-header-right am-header-nav">
    <a href="#">
      <div style="display: flex;flex-direction: column;margin-left: -40px;">
        <img src="images/rw.png" alt="管理员联系方式" style="width: 30px; height: 25px;">
        <span style="color: black; font-weight: 700; font-size: 12px;margin-left: -48px; margin-top: -14px;" onclick="rw()">任务</span>
      </div>
    </a>
    <a href="personal.html">
      <div style="display: flex;flex-direction: column;margin-left: -10px;">
        <img src="images/xr.png" alt="管理员联系方式" style="width: 25px; height: 20px;">
        <span style="color: black; font-weight: 700; font-size: 12px;margin-left: -18px; margin-top: -14px;" onclick="per()">我的</span>
      </div>
    </a>
  </div>
    <script>
            var id=sessionStorage.getItem('tasknum')
            console.log(id)
    </script>
  </header>

  
  <div class="am-container" style="background-color: rgba(241, 246, 249, 0.65); margin-top: 60px; 
   box-shadow: 5px 5px 5px rgba(0,0,0,0.1); 
  border-radius: 5px; ">
  <div class="am-g am-g-fixed" style="margin-top: 4vh;">
    <div class="am-u-sm-5 am-u-sm-centered" style="text-align: center; height: 40px; font-size:xx-large; 
    font-family: SimHei; font-weight: 700; color: #E87B17;">任务详情</div>
    
    <div class="am-g am-g-fixed" style="margin-top: 3.5vh;">
      <div class="am-u-sm-2 am-u-sm-offset-1" style="height: 500px;width: 200px; font-size:large; font-family: SimHei; font-weight: 700;
      background-color: #F6B541; margin-bottom: 4vh;
      border-top-left-radius: 50px;
      border-bottom-left-radius: 20px;
      border-bottom-right-radius: 20px;
      border-top-right-radius: 20px;">
      <ul style="list-style: none; font-size:large; font-family: SimHei; font-weight: 700;">
        <li style="margin-top: 2vh;"><img src="images/ss.png" style="width: 30px;height:30px">&nbsp;任务编号</li>
        <li style="margin-top: 2vh;"><img src="images/bq.png" style="width: 30px;height:30px">&nbsp;标签</li>
        <li style="margin-top: 2vh;"><img src="images/sj.png" style="width: 30px;height:30px">&nbsp;起止日期</li>
        <li style="margin-top: 2vh; margin-bottom: 13vh;"><img src="images/sx.png" style="width: 30px;height:30px;">&nbsp;详细描述</li>
        <li style="margin-top: 2vh;"><img src="images/renjia.png" style="width: 30px;height:30px">&nbsp;发起人</li>
        <li style="margin-top: 2vh;"><img src="images/dh.png" style="width: 30px;height:30px">&nbsp;联系方式</li>
      </ul>
      </div>
      <script src="../../routes/vue.js"></script>
      <div class="am-u-sm-8 am-u-end" id="cycle" style=" height: 500px; background-color: #F1F6F9; border-radius: 15px;" v-for="(item ,i) in arr">
        <ul style="list-style: none; font-size:large; font-family: SimHei; font-weight: 700;">
          <li id="num" style="background-color: #fff; margin-top: 2vh; width: 8vw;">{{item.tasknum}}</li>
          <li id="tag" style="background-color: #fff; margin-top: 2vh; width: 8vw;">{{item.tag}}</li>
          <li style=" margin-top: 2vh;">
            <label id="begindate" style="background-color: #fff; width: 8vw;">{{item.begintime}}</label>
            <span style="width: 8vw;">--</span>
            <label id="finaldate" style="background-color: #fff; width: 8vw;"> {{item.endtime}}</label>
          </li>
          <li style=" margin-top: 2vh;">
            <textarea id="taskinfo" class="" rows="4" id="doc-ta-1" style="width: 35vw; border-radius: 10px; background-color: #fff;" readonly>{{item.taskinfo}}</textarea>
          </li>
          <li id="faqiren" style="background-color: #fff; margin-top: 2vh; width: 8vw;">{{item.nickname}}</li>
        <li  id="contact" style="background-color: #fff; margin-top: 2vh; width: 8vw;">{{item.contact}}</li>
        <li> 
          <button type="button" id="acceptBtn" class="am-btn am-btn-danger am-round" style="background-color: #F6B541; width: 150px; height: 50px;
          margin-top: 8vh; color: #000; font-size: large;font-family: SimHei;font-weight: 700; margin-left: 7.5vw;outline: 0;" onclick="accept()">
          接受任务
        </button>
        </li>
        
        </ul>
      </div>
  </div>

  </div>
  
  </div>
<!-- 页脚 -->
<footer data-am-widget="footer"
class="am-footer am-footer-default"
 data-am-footer="{  }" style="background-color: rgba(255,255,255,0) ;">
<div class="am-footer-switch">
<span class="am-footer-ysp" data-rel="mobile"
data-am-modal="{target: '#am-switch-mode'}">
云适配版
</span>
<span class="am-footer-divider"> | </span>
<a id="godesktop" data-rel="desktop" class="am-footer-desktop" href="javascript:">
电脑版
</a>
</div>
<div class="am-footer-miscs ">

<p>由 <a href="http://www.yunshipei.com/" title="诺亚方舟"
                                      target="_blank">诺亚方舟</a>
  提供技术支持</p>
<p>CopyRight©2014  AllMobilize Inc.</p>
<p>京ICP备13033158</p>
<br>
<p>NaN团队--小蜜蜂图片收集网</p>
</div>
</footer>

<div id="am-footer-modal"
class="am-modal am-modal-no-btn am-switch-mode-m am-switch-mode-m-default">
<div class="am-modal-dialog">
<div class="am-modal-hd am-modal-footer-hd">
<a href="javascript:void(0)" data-dismiss="modal" class="am-close am-close-spin " data-am-modal-close>&times;</a>
</div>
<div class="am-modal-bd">
您正在浏览的是

<span class="am-switch-mode-owner">
  云适配
</span>

<span class="am-switch-mode-slogan">
    为您当前手机订制的移动网站。
</span>
</div>
</div>
</div>



<!--[if (gte IE 9)|!(IE)]><!-->
<!-- <script src="assets/js/jquery.min.js"></script> -->
<!--<![endif]-->
<!--[if lte IE 8 ]-->
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<!--[endif]-->
<script src="assets/js/amazeui.min.js"></script>


<script>

  function oneValues()
  {
    var result;
    var url=decodeURI(window.location.search); //获取url中"?"符后的字串  
    if(url.indexOf("?") != -1) {
        result = url.substr(url.indexOf("=")+1);
    }
    return result;
  }
  var http = new XMLHttpRequest()
    http.open('POST','http://localhost/search')
    http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    http.send('key=' + oneValues())
    http.onreadystatechange = function()
            {
                if(http.readyState == 4 && http.status == 200)
                {
                    console.log(http.responseText)
                    // console.log(eval(http.responseText))
                    var theNew = JSON.parse(http.responseText).a
                    console.log(theNew)
                    if(http.responseText.indexOf(true)+1)
                    {
                      console.log(theNew[0])
                      vm.arr.push(theNew[0])
                    }
                }
            }
  const acceptBtn=document.getElementById("acceptBtn");
      // 绑定事件
  function accept(){
      // 创建对象
      const num= vm.arr[0]['tasknum']
      const username = window.sessionStorage.getItem('username')
      console.log(num)
      console.log(username)
      const xhr=new XMLHttpRequest();
      xhr.open('POST','http://localhost/accepttask');
      xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
      xhr.send('username=' + username + '&num=' + num);
      xhr.onreadystatechange=function(){
          // 判断
          if(xhr.readyState == 4 && xhr.status == 200){
                  // 处理服务端返回的结果
                  console.log(xhr.response);
                  window.location.href='jobjieshou.html'
          }
      }
  }
  var vm = new Vue({
        el: '#cycle',
        data: {
          arr:[]
        },
        methods: {
            details: function(a) {
              console.log(a)
              vm.arr.push(a)
              console.log(vm.arr.length)
            }
        }
    })
    function rw(){
    window.location.href='./jobfachu.html'
  }
  function yfpage(){
    window.location.href='./yfpage.html'
  }

</script>

</body>
</html>